#include <stdio.h>
int main()
{
    long input;
    int sum;
    scanf("%ld", &input);
    int x = input % 10;
    while (input > 0)
    {
        sum = sum + x;
        input = input / 10;
        x = input % 10;
    }
    printf("%d", sum);
    return 0;
}